<template>
	<view>
		<u-cell-group>
			<view class="aac" ></view>
				<u-cell class="set2" @click="tel"	:value="phone" title="绑定的优购账户" label="默认绑定手机号" isLink></u-cell>
			<view class="aac" ></view>
				
			
			<view v-for="(item,index) in account" :key="index" @click="payment(item)">
				<u-cell class="set1" :value="item.value" :title="item.titile"  :label="item.label" isLink></u-cell>
			</view>
		</u-cell-group>
		<view class="bb">
			<u-link href="https://uviewui.com/" text="《优购许可使用协议》" @click="click"></u-link>
		</view>
	</view>
</template>

<script>
	import {mapState} from "vuex"
	export default {
		data() {
			return {
				account: [
					{
						value: '指纹、刷脸',
						titile: '人脸/指纹支付',
						label:''
					},
					{
						value: '未开通',
						titile: '先用后付',
						label:'收货满意在付款'
					},
					{
						value: '未开通',
						titile: '小额免密师傅',
						label:"免密支付,快人一步"
					},
				],
				phone:'',
			};
		},
		computed:{
			...mapState("login",["userinfo"])
		},
		onLoad(){
			uni.$setNavigationBarColor()
			let a =  this.userinfo.phone.substr(0,3)
			let b = this.userinfo.phone.substr(this.userinfo.phone.length-2,this.userinfo.phone.length)
			let c = '*******'
			this.phone = a + c + b
		},
		methods:{
			//手机号
			tel(){
				uni.navigateTo({
					url:"/subAbility/modifyAccount/modifyAccount?titile=手机号"
				})
			},
			//支付
			payment(item){
				if(item.value == "指纹、刷脸"){
						uni.navigateTo({
							url:"/subAbility/biologicalPayment/biologicalPayment"
						})
				}else{
					uni.$showToast("暂未支持,请销后","error")
				}
				
			}
		}
	}
</script>

<style lang="scss">

.aac{
	height: 10px;
	background-color: #f7f7f7;
}
	.bb {
		position: absolute;
		bottom: 50px;
		left: 50%;
		right: 0;
		transform: translateX(-40%);

	}
</style>
